function n = ndims(htio)
% transio::ndims  - return number of dimensions of underlying data
%
% FORMAT:       ND = ndims(obj)
%
% Input fields:
%
%       obj         1x1 transio object
%
% Output fields:
%
%       ND          number of dimensions

% Version:  v0.7g
% Build:    9101517
% Date:     Oct-15 2009, 5:05 PM CEST
% Author:   Jochen Weber, SCAN Unit, Columbia University, NYC, NY, USA
% URL/Info: http://wiki.brainvoyager.com/BVQXtools

try
    stio = struct(htio);
    n = numel(stio.DataDims);
catch
    error( ...
        'transio:BadArgument', ...
        'Invalid transio object.' ...
    );
end
